package com.wyc.apiboss.controller;

import com.wyc.apiboss.service.DriverCarBindingRelationshipService;
import com.wyc.internalCommon.request.DriverCarBindingRelationshipDTO;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 司机车辆信息管理
 */
@RestController
public class DriverCarBindingRelationshipController {

    @Autowired
    private DriverCarBindingRelationshipService driverCarBindingRelationshipService;

    /**
     * 司机绑定车辆
     * @param driverCarBindingRelationshipDTO
     * @return
     */
    @PostMapping("/driver-car-bind")
    public ApiResult bind(@RequestBody DriverCarBindingRelationshipDTO driverCarBindingRelationshipDTO){
        return driverCarBindingRelationshipService.bind(driverCarBindingRelationshipDTO);
    }

    /**
     * 司机解绑车辆
     * @param driverCarBindingRelationshipDTO
     * @return
     */
    @PostMapping("/driver-car-unbind")
    public ApiResult unBind(@RequestBody DriverCarBindingRelationshipDTO driverCarBindingRelationshipDTO){
        return driverCarBindingRelationshipService.unBind(driverCarBindingRelationshipDTO);
    }

}
